<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../js/jquery-1.10.1.min.js"></script>
  <style>
    * {
      padding: 0;
      margin: 0;
    }

    h3 {
      line-height: 60px;
    }

    li {
      list-style: none;
      line-height: 40px;
      border: 1px dashed #333;
    }

    .list {
      overflow: hidden;
    }

    .active {
      background-color: #6ff;
    }
  </style>
</head>

<body>
  <div class="wrap">
    <h3 id="title">批量操作元素</h3>
    <ul class="list">
      <li class="first">01</li>
      <li>02</li>
      <li>03</li>
      <li>04</li>
      <li>05</li>
      <li><span>06</span></li>
    </ul>
    <h2>123123</h2>
    <!-- <ul class="list">
      <li class="first">01</li>
      <li>02</li>
      <li>03</li>
      <li>04</li>
      <li>05</li>
      <li>06</li>
    </ul> -->
    <button class="getBtn">获取选中</button>
    <div class="box">
      <input type="checkbox" class="check-one">
      <input type="checkbox" class="check-one">
      <input type="checkbox" class="check-one">
      <input type="checkbox" class="check-one">
      <input type="checkbox" class="check-one">
    </div>

    <select name="" id="">
      <option value="2001">2001</option>
      <option value="2002">2002</option>
      <option value="2003">2003</option>
      <option value="2004">2004</option>
      <option value="2005">2005</option>
      <option value="2006">2006</option>
      <option value="2007">2007</option>
      <option value="2008">2008</option>
      <option value="2009">2009</option>
      <option value="2010">2010</option>
      <option value="2011">2011</option>
      <option value="2012">2012</option>
      <option value="2013">2013</option>
      <option value="2014">2014</option>
      <option value="2015">2015</option>
      <option value="2016">2016</option>
      <option value="2017">2017</option>
      <option value="2018">2018</option>
      <option value="2019">2019</option>
      <option value="2020">2020</option>
      <option value="2021">2021</option>
    </select>
  </div>
</body>
<script>

  //父元素
  //parent()  返回匹配元素的父元素

  // console.log($(".first"));
  // console.log($('.first').parent());
  // console.log($('.first').parent().parent());
  // console.log($('.first').parent().parent().parent());

  //parents()  返回匹配元素的父代元素
  //parents(selector)  
  console.log($(".first").parents());
  console.log($(".first").parents(".wrap"));

</script>

</html>